import request from '../../utils/request'

const group_name = "bookshop-category"
const api_name = "category"

/**分页条件查询分类 */
export function getCategoriesByCondition(queryCondition) {
    return request({
        url: `/${group_name}/${api_name}/querypage`,
        method: 'post',
        data: queryCondition
    })
}

/**查询所有分类 */
export function getCategories() {
    return request({
        url: `/${api_name}/categories`,
        method: 'GET'
    })
}

/**根据id查询分类 */
export function getCategoryById(id) {
    return request({
        url: `/${api_name}/get/${id}`,
        method: 'GET'
    })
}

/**删除分类 */
export function deleteCategory(id) {
    return request({
        url: `/${api_name}/remove/${id}`,
        method: 'DELETE'
    })
}